Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-user is "iotdirectory-new-device-from-model">
It allows to create a device from model
Inputs
A JSON with these parameters:
- devicename
string
- The name of the device you want to create
- latitude
number
- latitude of a GPS position
- longitude
number
- longitude of a GPS position
- wktGeometry
string
- Vector geometry for the device. Supported Wkt objects: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION
- k1
UUID v4 format
- K1 and K2 are the keys necessary to read and write access to the device. They must be different from each other.
- k2
UUID v4 format
- K1 and K2 are the keys necessary to read and write access to the device. They must be different from each other.
- model
string
- The name of the model
- staticAttributes
array
- A vector containing as elements the data of the static attributes associated with the device. Each element must contain the URI of the attribute and the value.
"staticAttributes": [
{
"uri": "http://schema.org/addressLocality",
"value": "Florence"
},
{
"uri": "http://schema.org/addressRegion",
"value": "Tuscany"
}
]
Outputs
- Returns the k1 and k2 of device created
Details
The node can receive a JSON with the parameters described in the Inputs section and with them generate the output JSON.
If the values are not present in the input JSON, these are read by those in the configuration. If they are not present
in either part, an error is generated for the necessary parameters.